home *** CD-ROM | disk | FTP | other *** search
/ Magnum One / Magnum One (Mid-American Digital) (Disc Manufacturing).iso / d18 / lotus1.arc / TEST123.PAS < prev    next >
Pascal/Delphi Source File  |  1991-04-28  |  4KB  |  75 lines

  1. {$N+,E+}  (*  $N+ compiles for math coprocessor which will be used *)
  2.           (*  automatically if available.  E+ activates the        *)
  3.           (*  80X87 emulator which will be used if a coprocessor   *)
  4.           (*  is not present.  I understand that these are program *)
  5.           (*  wide options and cannot be used in a unit separately *)
  6.  
  7. (*  Written by Dan Glanz, Alexandria, Virginia (76672,2572), May, 1989. *)
  8. (*  as a public service.                                                *)
  9. (*  There are no restrictions on use and no gaurantees that it works.   *)
  10.  
  11. (*    All I ask is a smidgeon of credit.                          *)
  12. (*  If you include this in a program, leave the credit line in. *)
  13. (*  If you modify the unit, add your own credit line.           *)
  14.  
  15.  
  16. Program Test123;
  17. uses crt, dos, Unit123;
  18.  
  19. (****************************************************************)
  20. (*              Demonstration and test program                  *)
  21. (*                                                              *)
  22. (*     This demonstration is to be used with the unit "UNIT123" *)
  23. (*     which is in the same ARC file.                           *)
  24. (*                                                              *)
  25. (*     Reads any Lotus file and copies the file read to another *)
  26. (*     file minus any blank cells, cells containing format      *)
  27. (*     range names and other information.  Formulas are not     *)
  28. (*     copied but the current value of formats is copied to the *)
  29. (*     new file as a real cell value. The new file will be      *)
  30. (*     located in the same directory and will have the same     *)
  31. (*     name as the old file except that the extension will      *)
  32. (*     be set to ".WK!".                                        *)
  33. (*                                                              *)
  34. (*     Pauses after each cell is read and displays the contents *)
  35. (*     of the cell.  Press any key to continue.                 *)
  36. (*                                                              *)
  37. (****************************************************************)
  38.  
  39. var
  40.     Response : char;
  41.  
  42. begin
  43.     Get_Input_File_Name;         {Solicits the input file name from console}
  44.  
  45.     Open_Lotus_Read_File;        {Open a WKS, WK1 file and read version  }
  46.  
  47.     Make_New_File_Name;          {Make new file name with .WK! extension }
  48.  
  49.     Open_Lotus_Write_File;       {Open the new file for writing          }
  50.  
  51.     repeat
  52.         Read_Lotus_Record ;
  53.         Print_Lotus_Record;               {Display record read (except }
  54.                                           {blank records, which are a  }
  55.                                           {waste of time               }
  56.  
  57.         Write_Lotus_Record;               {Write the record read to the}
  58.                                           {new file}
  59.  
  60.         Response := ReadKey;            {Pause after reading, writing and   }
  61.          If Response = #27 then          {printing each record.     }
  62.             begin                       {Press any key to continue }
  63.                 Close_Lotus_Write_File; {or Esc to stop.  If you   }
  64.                 halt;                   {stop in the middle of     }
  65.             end;                        {copying, the new file will}
  66.                                         {still be usable.          }
  67.     until Lotus_End_Of_File;
  68.  
  69.  
  70.     Close_Lotus_Write_File;                {Writes a Lotus end of file}
  71.                                            {and closes the file}
  72.  
  73.     Writeln('Done reading and writing.');
  74.  
  75. end.